<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @property bool $status 审核状态:1=审核中,2=打款中,3=驳回,4=已到账,5=未到账
 * @property float $amount 提现金额
 * @property float $fee 手续费
 * @property float $real_amount 到账金额
 * @property int $bank_id 银行卡
 * @property int $id
 * @property int $user_id 用户
 * @property string $account 卡号
 * @property string $bank 银行
 * @property string $bank_name 开户行
 * @property string $createtime
 * @property string $idcard 身份证号
 * @property string $mobile 开户手机号
 * @property string $name 姓名
 * @property string $order_sn 订单编号
 * @property string $reason 原因
 * @property-read mixed $status_text
 * @mixin \think\Model
 */
class UserWithdraw extends Model
{

	protected $createTime = 'createtime';
	
	protected $append = [
		'status_text',
	];
	
	public function getStatusTextAttr($value, $data)
	{
		$value = $value ? $value : ($data['status'] ?? '');
		$list = ['1' => '审核中', '2' => '打款中', '3' => '驳回', '4' => '已到账', '5' => '未到账'];
		return $list[$value] ?? '';
	}
}
